package com.qf.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

/**
 * @author wgy
 * @version V1.0
 * @project gp12_xiaomi
 * @package com.qf.utils
 * @description: ${TODO}
 * @date 2022/6/22 14:53
 */
public class RandomUtils {
    //生成激活码
    public static String createActiveCode(){
        SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String s1=sdf.format(new Date());
        String s2=Integer.toHexString(new Random().nextInt(99999));
        return s1+s2;
    }

    //生成订单号
    public static String createOrderId(){
        SimpleDateFormat sdf=new SimpleDateFormat("yyyyMMddHHmmssSSS");
        String s1=sdf.format(new Date());
        int s2=new Random().nextInt(99999);
        return s1+s2;
    }
}
